package com.td.erhome.net;

import com.td.erhome.models.ArticleBean;
import com.td.erhome.models.BaseBean;
import com.td.erhome.models.CityInfo;
import com.td.erhome.models.CostListBean;
import com.td.erhome.models.CouonBaen;
import com.td.erhome.models.HouseBean;
import com.td.erhome.models.HouseIdBean;
import com.td.erhome.models.PayRey;
import com.td.erhome.models.User;
import com.td.erhome.models.VersinCodeBean;

import java.util.HashMap;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by Administrator on 2016/10/8 0008.
 */

public interface  ApiService {

    /**
     * 登录时获取验证码
     *
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("user/sendLoginCaptcha")
    Observable<BaseBean> sendLoginCaptcha(@FieldMap HashMap<String, Object> params);

    /**
     * 登录时获取验证码
     *
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("user/checkLoginCaptcha")
    Observable<BaseBean<User>> checkLoginCaptcha(@FieldMap HashMap<String, Object> params);

    /**
     *
     * 得到街道信息
     */
    @GET("area/getChengDuAreaInfo")
    Observable<CityInfo> getChengDuAreaInfo();


    /**
     * cht 图片上传
     *
     * @param photo
     * @return
     */
    @POST("user/saveProfile")
    Observable<BaseBean<User>> saveProfile(@Body RequestBody photo);

    /**
     * cht 发布房源
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("house/addSellHouseStep1")
    Observable<BaseBean<HouseIdBean>> addSellHouseStep1(@FieldMap HashMap<String, Object> params);

    /**
     * cht 发布房源2
     * @param
     * @return
     */
    @POST("house/addSellHouseStep2")
    Observable<BaseBean<HouseIdBean>> addSellHouseStep2(@Body RequestBody photo);

    /**
     * 退出登录
     */
    @POST("user/logoff")
    Observable<BaseBean> logoff(@QueryMap HashMap<String, Object> params);

    /**
     * 获得自己发布的房源列表
     */
    @GET("house/getSellHouseList")
    Observable<BaseBean<HouseBean>> getSellHouseList(@QueryMap HashMap<String, Object> params);

    /**
     * 修改房源
     * @param
     * @return
     */
    @POST("house/editSellHouse")
    Observable<BaseBean> editSellHouse(@Body RequestBody photo);

    /**
     * cht 发布房源
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("house/deleteSellHouse")
    Observable<BaseBean> deleteSellHouse(@FieldMap HashMap<String, Object> params);

    /**
     * 查看所有在售的房子
     */
    @GET("house/getOnSellHouseList")
    Observable<BaseBean<HouseBean>> getOnSellHouseList(@QueryMap HashMap<String, Object> params);

    /**
     * 将某房添加到浏览记录
     */
    @FormUrlEncoded
    @POST("user/saveReviewInfo")
    Observable<BaseBean> saveReviewInfo(@FieldMap HashMap<String, Object> params);

    /**
     * 收藏
     */
    @FormUrlEncoded
    @POST("user/addToFavorite")
    Observable<BaseBean> addToFavorite(@FieldMap HashMap<String, Object> params);

     /**
     * 取消收藏
     */
    @FormUrlEncoded
    @POST("user/cancelFavorite")
    Observable<BaseBean> cancelFavorite(@FieldMap HashMap<String, Object> params);

    /**
     * 查看我的浏览记录
     */
    @GET("user/getReviewInfoList")
    Observable<BaseBean<HouseBean>> getReviewInfoList(@QueryMap HashMap<String, Object> params);

    /**
     * 我的收藏记录
     */
    @GET("user/getFavoriteList")
    Observable<BaseBean<HouseBean>> getFavoriteList(@QueryMap HashMap<String, Object> params);

    /**
     * 我的收藏记录
     */
    @GET("article/getArticleList")
    Observable<BaseBean<ArticleBean>> getArticleList(@QueryMap HashMap<String, Object> params);
    /**
     * 获得我的优惠券
     */
    @GET("user/getCouponList")
    Observable<BaseBean<CouonBaen>> getCouponList(@QueryMap HashMap<String, Object> params);

    /**
     * 兑换优惠码
     */
    @FormUrlEncoded
    @POST("user/exchangeInvitecode")
    Observable<BaseBean> exchangeInvitecode(@FieldMap HashMap<String, Object> params);

    /*
     * *
     */
    @FormUrlEncoded
    @POST("house/sellHousePublish")
    Observable<BaseBean<PayRey>> sellHousePublish(@FieldMap HashMap<String, Object> params);

     /*
     * *微信登录1
     */
    @FormUrlEncoded
    @POST("user/uploadWechatInfo")
    Observable<BaseBean<User>> uploadWechatInfo(@FieldMap HashMap<String, Object> params);

    /*
     * *微信登录
     */
    @FormUrlEncoded
    @POST("user/bindAccountInfo")
    Observable<BaseBean<User>> bindAccountInfo(@FieldMap HashMap<String, Object> params);

    /*
     * *付费得到房主信息
     */
    @FormUrlEncoded
    @POST("house/getSellerInfo")
    Observable<BaseBean<PayRey>> getSellerInfo(@FieldMap HashMap<String, Object> params);

    /**
     * 历史价格记录
     */
    @GET("house/getSecondHouseBuyRecord")
    Observable<BaseBean<CostListBean>> getSecondHouseBuyRecord(@QueryMap HashMap<String, Object> params);

    /**
     * 看房记录
     */
    @GET("house/getBuyHouseList")
    Observable<BaseBean<HouseBean>> getBuyHouseList(@QueryMap HashMap<String, Object> params);

    /*
    * *退押金
    */
    @FormUrlEncoded
    @POST("house/applyRefund")
    Observable<BaseBean> applyRefund(@FieldMap HashMap<String, Object> params);

    /*
    * *扫描推广人员二维码获得金额
    */
    @FormUrlEncoded
    @POST("user/scanQrcode")
    Observable<BaseBean> scanQrcode(@FieldMap HashMap<String, Object> params);


      /*
    * *抵扣
    */
    @FormUrlEncoded
    @POST("user/deductAmount")
    Observable<BaseBean> deductAmount(@FieldMap HashMap<String, Object> params);

    /**
     * 优惠券列表
     */
    @GET("user/getAmountdetail")
    Observable<BaseBean<CouonBaen>> getAmountdetail(@QueryMap HashMap<String, Object> params);

    /**
     * 检查版本跟新
     */
    @GET("index/getAppVersion")
    Observable<BaseBean<VersinCodeBean>> getAppVersion();

}
